<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import="struct.ItemInfo" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, maximum-scale=1">
    <meta name="description" content="Modern UI CSS">
    <meta name="author" content="Sergey Pimenov">
    <meta name="keywords" content="windows 8, modern style, modern ui, style, modern, css, framework">
    
    <meta http-equiv="refresh" content="900" />

    <link href="css/modern.css" rel="stylesheet">
    <link href="css/theme-dark.css" rel="stylesheet">
    <link href="css/modern-responsive.css" rel="stylesheet">

    <script src="js/assets/jquery-1.8.2.min.js"></script>
    <script src="js/assets/google-analytics.js"></script>
    <script src="js/assets/jquery.mousewheel.min.js"></script>
    <script src="js/assets/github.info.js"></script>
    <script src="js/modern/tile-slider.js"></script>
    <script src="js/modern/start-menu.js"></script>

    <title>Item Detail</title>

    <style>
        body {
            background: url(icon/wallpaper1.jpg);
        }
    </style>
    
</head>
<body class="metrouicss">

<%
String username = request.getParameter("username");
ItemInfo itemInfo = (ItemInfo)request.getAttribute("itemInfo");
%>	

<div class="page secondary fixed-header">
    <div class="page-header ">
        <div class="page-header-content">
        
        	<div class="user-login">
                <a href="#">
                    <div class="name">
                        <span class="first-name"><%=username %></span>
                    </div>

                </a>
            </div>

            <h1 class="fg-color-white">Item Detail</h1>
        </div>
    </div>

    <div class="page-region">
	<br>
        <div class="page-region-content tiles">
            <div class="tile-group">
												
				<div class="tile double bg-color-red">
                    <div class="tile-content">
                        <br>
                        	<br>
                        	<br>
                            <h2 align="center"><%=itemInfo.itemName %></h2>
                    </div>
					<div class="brand">
						<div class="name">Item Name: </div>
					</div>
                </div>
                
                <div class="tile double bg-color-darken">
                    <div class="tile-content">
                        <br>
                        	<br>
                        	<br>
                            <h2 align="center"><%=itemInfo.description %></h2>
                    </div>
					<div class="brand">
						<div class="name">Item Description: </div>
					</div>
                </div>
				
				<div class="tile bg-color-darken">
					<div class="tile-content">
						<p>
                        	<br>
                        	<br>
                        	<br>
                            <%if(itemInfo.currentBid ==0){ %>
                            	<h2 align="center">None</h2>
                            <%}else { %>
                            	<h2 align="center"><%=itemInfo.currentBid %></h2>
                            <%} %>
                        </p>
					</div>
					<div class="brand">
						<div class="name">Current Bid</div>
					</div>
				</div>
								
				<div class="tile bg-color-darken">
					<div class="tile-content">
						<p>
                        	<br>
                        	<br>
                        	<br>
                            <h2 align="center"><%=itemInfo.timeLeft %></h2>
                        </p>
					</div>
					<div class="brand">
						<div class="name">Time Left</div>
					</div>
				</div>
					
            </div>
			
			<div class="tile-group">
							
				<a href="/SellerInfo?username=<%=username%>&seller=<%=itemInfo.seller%>">				
				<div class="tile double bg-color-green">
					<div class="tile-content">
						<p>
                        	<br>
                        	<br>
                        	<br>
                            <h2 align="center"><%=itemInfo.seller %></h2>
                        </p>
					</div>
					<div class="brand">
						<div class="name">Seller: Click here to comment and rate</div>
					</div>
				</div>
				</a>
				
				
				
				<div class="tile bg-color-darken">
                    <div class="tile-content">
						<br>
							<form action = "/Bid?username=<%=username%>" method = "get">
								<div class="input-control text span1 as-block" >
									<input type="text" name = "bid" maxlength="15" style="background-color: black;"/>
								</div> <br>
								<input type="hidden" name="itemID" value=<%=itemInfo.itemID %>>
								<input type="hidden" name="currentBid" value=<%=itemInfo.currentBid %>>
								<input type = "hidden" name = "username" value = <%=username%>>
								<input type="submit" value="Bid"/>
							</form>

                    </div>	
					
                </div>
                
                <div class="tile bg-color-darken">
                    <div class="tile-content">
						<br>
							<form action = "/DirectToItemDetailPage" method = "get">
								<br><br><br><br>
								<input type="hidden" name="username" value=<%=username %>>
								<input type="hidden" name="itemID" value=<%=itemInfo.itemID %>>
								<input type="submit" value="Refresh" onClick="window.location.reload()">
							</form> 
                    </div>	
					
                </div>
									
            </div>
								
        </div>
    </div>
</div>

</body>
</html>